System and method for connection efficiency

ABSTRACT

In a distributed object computing system, a server application may create multiple, uniquely identified, server contexts that each provide one or more services to a service consumer (client). Instead of creating a connection to a client for each server context, a single connection can be used. A service request handler may be configured to handle service requests for each server context. Service requests may be generated in the client with a service context identity. When a service request is received by the server application, the service request handler resolves the service context identity and forwards the service request to the appropriate server context.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. Ser. No. 13/078,950, entitledSYSTEM AND METHOD FOR CONNECTION EFFICIENCY, filed on Apr. 2, 2011, nowissued U.S. Pat. No. 9,002,994, issued on Apr. 7, 2015, incorporatedherein by reference in its entirety.

FIELD OF THE INVENTION

This disclosure relates primarily, though not exclusively, todistributed object computing and to systems and methods forcommunicating between server and client applications.

BACKGROUND OF THE INVENTION

The present Applicants and Assignees have developed a distributed objectplatform known proprietarily as Voyager. The following specificationmakes specific reference to Voyager. However, the examples andreferences described are not intended to be limited to the specificVoyager platform and nor its specific features and capabilities. Themethods and examples to be described will have application to otherplatforms, and in particular to other distributed object systems.

A distributed application, such as Voyager and other distributedobject/ORB systems, may, in some situations, create multiple connectionsbetween the same pair of application instances. These unsharedconnections unnecessarily consume network, memory, and processorresources. In particular, establishing a connection between applicationinstances over a network requires significant time, time that isconsidered nonproductive overhead. For TCP connections the maximum timeallowed for creating a physical connection is commonly set to 1 secondor longer. Exchanging initial information, i.e., handshaking over a newconnection to establish a higher level logical connection, e.g., toencrypt the connection or to verify the identity of each end of theconnection, adds to the overhead.

One common solution to this problem is to pool (cache) connections atthe physical level. When an application wishes to connect to a remotemachine, it first checks the pool for an existing connection. If itfinds one it uses that connection. The identity of the remote machine,used to search the pool, is the network address of the remote machine.However, using the network address as the identity of a computer failsto account for a state change at the remote computer, e.g., a restart ofthe application. Using the network address as the only identifier mayalso enable “man in the middle” attacks.

What is required is an improved system and method for providingconnections between client and server applications.

SUMMARY OF THE INVENTION

In a distributed object computing system, a server application maycreate multiple, uniquely identified, server contexts that each provideone or more services to a service consumer (client). Instead of creatinga connection to a client for each server context, a single connectioncan be used. A service request handler may be configured to handleservice requests for each server context. Service requests may begenerated in the client with a service context identity. When a servicerequest is received by the server application, the service requesthandler resolves the service context identity and forwards the servicerequest to the appropriate server context.

In one aspect of the disclosure, there is provided a method forproviding services from a service provider to a service consumer. Aplurality of server contexts may be configured at a device. Each servercontext may comprise a unique server context identity and one or moreindexed services. Each server context may be configured to provide anindexed service in response to a service request. A service requesthandler may handle service requests for the plurality of servercontexts. The service request handler may resolve a server contextidentity of the service request and forward the service request to theresolved server context. The server context may retrieve an indexedservice in the server context and generate a service response in theserver context, the service response comprising the result of aninvocation of the retrieved indexed service.

In one aspect of the disclosure, there is provided a method for sharinga connection from a client application on a client device to a serverapplication on a server device comprising a plurality of servercontexts. An endpoint may be configured in the client applicationcomprising a connection to the server application. A plurality of clientcontexts may be configured in the client application, each clientcontext comprising a reference to one of the plurality of servercontexts. A service request may be generated that comprises a servicerequest ID, a namespace ID that identifies one of the plurality ofserver contexts, and a service index that identifies a service withinthe identified server context. The service request may be provided fromthe client application to the service application on the connection.

In one aspect of the disclosure, there is provided a system comprising aserver device executing a server application configured to create aplurality of server contexts at a network address of the server deviceand at least one client device executing a client application. Eachserver context comprises a server context identity (referred to as anamespace ID) independent of the network address and one or morereferenced services. The client application may be configured to createa plurality of client contexts as proxies for the one or more referencedservices of a respective server context and generate a service requestfor the one or more referenced services, the service request comprisinga server context identity. At least one of the client application andthe server application may be configured to create a network connectionbetween the client application and the server application such that aplurality of service requests to a plurality of the server contexts areable to be provided over the same connection.

BRIEF DESCRIPTION OF THE DRAWINGS

Reference will now be made, by way of example only, to specificembodiments and to the accompanying drawings in which:

FIG. 1 shows a distributed object computing platform with a clientinstance and a server instance;

FIG. 2 shows the distributed object computing platform at a state ofbeing ready to process service requests;

FIG. 3 shows the distributed object computing platform with a singleclient context and a single server context;

FIG. 4 shows a method for providing a service request; and

FIG. 5 shows the distributed object computing platform with multipleclient contexts and multiple server contexts.

DETAILED DESCRIPTION OF THE INVENTION

The description and understanding of the present embodiments will befacilitated by a brief summary of the Voyager platform, made withreference to FIG. 1, some aspects of which may relate to similardistributed object computing systems. A person skilled in the art willreadily understand that not all aspects of the Voyager platform arenecessary for performing the present embodiments.

In FIG. 1, there is shown an instance of a distributed objectapplication operating as a service provider on a server device. Theserver device may be a computing system comprising at least oneprocessor and at least one operatively associated memory. The memory maystore executable instructions for executing the server application. FIG.1 also shows an instance of a distributed object application operatingas a service consumer or client on a client device. The client devicemay be a computing system comprising at least one processor and at leastone operatively associated memory. The memory may store executableinstructions for executing the client application. While only a singleserver instance and a single client instance is shown, the network mayinclude multiple servers and multiple clients.

A network connection may be defined as a Level 1 connection. Level 1connections are typically created and managed using services provided byan operating system and/or programming language. A TCP connection overan Ethernet LAN is an example of a Level 1 connection.

An “Endpoint” may be defined as a Level 2 connection. An Endpoint is oneend of a Level 1 connection between two independent copies of Voyager.An Endpoint can be created by a server that accepts connection requestsor by a client when a connection is required. An Endpoint typicallymanages one end of a network connection, e.g., a TCP socket. AnEndpoint's identity is the identity of the application instance (Voyagerinstance) containing it. An Endpoint also contains zero or more networkaddresses, used to identify the Level 1 network connections it containsor could contain, and zero or more Level 1 connections, each identifiedby a network address. FIG. 1 shows a client side endpoint 15 and aserver side endpoint 43.

When two Endpoints connect using a Level 1 connection they exchange ahandshake packet that contains at least the identity of each Endpoint.

The connection between a service consumer and a collection of servicesoffered by a service provider may be defined as a Level 3 connection.

A ServiceRequestHandler 23 may be defined as the Endpoint container atthe service provider end of a Level 3 connection. AServiceRequestHandler 23 routes a ServiceRequest to a ServerContext 22.

A ClientContext 13 may be defined as the service consumer at one end ofa Level 3 connection. A ClientContext 13 typically references oneEndpoint 15. A ClientContext's identity is the same as the identity ofthe ServerContext 22 at the other end of the logical connection.

Establishing a Level 3 connection involves associating a ClientContext13 and a ServerContext 22 with a Level 2 connection. To establish theClientContext end, an application provides the ClientContext 13 with anappropriate Endpoint 15. The ClientContext 13 then sends a request for aLevel 3 connection over the Level 1 connection managed by the providedEndpoint 15. The request includes at least the identity of theServerContext whose services the ClientContext requires. The Voyagerthat receives the request for a Level 3 connection identifies theServerContext and asks the ServerContext to establish the Level 3connection.

The connection between a single identified service provider and a singleservice consumer may be defined as a Level 4 connection. In Voyagerterms, a service provider is an exported object, and a service consumeris the API of a service provider realized by the service provider'sproxy.

A ServerContext 22 may be defined as the service provider manager at theservice end of a Level 4 connection. A ServerContext 22 has a uniqueidentity and is not directly associated with an Endpoint 43.

The lifetime of a Level 1 connection, which is managed by the containingEndpoint, may be the same as or shorter than the lifetime of anEndpoint.

The lifetime of an Endpoint, a Level 2 connection, is managed by theapplication.

The lifetime of a Level 3 connection, i.e., a ClientContext or aServerContext, is managed by the application, and may be the same as orshorter than the lifetime of an Endpoint.

A Level 1 connection may be shared by zero or more Level 2 connections.

A Level 2 connection may be shared by zero or more Level 3 connections.

A Level 3 connection may be shared by zero or more Level 4 connections.

A ClientContext references a single ServiceRequestHandler.

A ServerContext may be referenced by zero or moreServiceRequestHandlers.

With the foregoing described as a basis of a distributed objectcomputing system, the present embodiments will now be described withreference to the Figures.

In FIG. 1, there is shown a system 10 that includes an application 11operating as a client or Service Consumer and a second application 21operating as a server or Service Provider. The applications on theProvider and Consumer side might be different or the same. That is, theapplication 11 and application 21 may be first and second instances ofthe same application or may be distinct Service Consumer and ServiceProvider applications. In the example depicted, the first and secondinstances are indicated as instances of the Applicant's proprietaryVoyager application. However, this is but one example only and otherexamples of client and server applications will be apparent to a personskilled in the art.

FIG. 1 also shows the relationships among the items. In FIG. 1, an opendiamond arrowhead, e.g. NetworkConnection 26, shows inheritance (i.e. an“is a” relationship) while an open arrowhead, e.g. on the line betweenProxy 12 and ClientContext 13, shows a reference. A box at one end of areference indicates that the line represents a collection with the itemin the box as the key used to find a specific instance within thecollection.

As outlined above, services may be invoked on client applicationsthrough a proxy 12 that invokes a service from a service provider 21.The service may be invoked via a service request from the proxy to aServerContext 22 that stores the service.

In accordance with an embodiment of the present disclosure, efficientservice may be facilitated by establishing a namespace identity thatuniquely identifies a service provider, such as a ServerContext 22. TheServerContext 22 provides a service index of services available from theServerContext. That is, a service may be identified by the combinationof a service index and the namespace within which the index can beresolved.

A service request may contain a single request for service, includingthe service request's id, the service namespace's globally uniqueidentifier (GUID), a service index and any arguments needed to invokethe service. An example service request 31 is shown in FIG. 1. A serviceresponse may contain the service request id (used to associate theresponse with the request when the ServiceResponse arrives at theService Consumer), a flag that is true if the service failed, and thevalue the service returned. If the flag is true, the value will be areport of the failure; otherwise the value is the result of a successfulservice invocation. An example of a service response 32 is shown in FIG.1.

The system uses the (service index, service namespace GUID) tuple toidentify the specific service when the service request passes from theservice requestor to the service provider over a connection shared bymultiple service requestors and multiple service provider namespaces.This arrangement allows multiple ClientContexts to use the same endpointand same Level 1 connection to access different ServerContexts of aserver application. At the server side, multiple ServerContexts are ableto share a common ServiceRequestHandler 23 and endpoint 43. The commonServiceRequestHandler contains the mapping of a service namespace GUID(where the service namespace is managed by a ServerContext) to therealization of the namespace (a specific ServerContext 22).

FIG. 2 shows the system 10 at a time when the Service Provider 21 isready to process requests for services and the Service Consumer 11 isready to begin issuing requests for services. FIG. 2 is an instancediagram, i.e., this diagram shows object instances created using thetypes shown in FIG. 1. Each instance has a name, separated from theinstance type by a colon. For example, “ServerA1: ClientContext” meansthe instance is a ClientContext named ServerA1. Inside ServerA1 there is“anEndpoint=EndpointC1”, meaning the attribute (aka variable) namedanEndpoint has the value EndpointC1. In this case the value is areference to the Endpoint identified as EndpointC1, not the literalstring “EndpointC1”.

In FIG. 2, the Service Provider's 21 startup processing has created aServerContext 22, given it a name and created a unique identifier(aNamespaceId). In one embodiment, the name may be human-orientedprintable name. The ServerContext 22 creates an ObjectRequestBroker 36and exports an Application Object, ApplObj1 27. While a singleapplication object 27 is shown, a single server context may provide anynumber of application objects as required. The application objects maybe identified by a service index in the Object Request Broker 36. Theserver application asks the Transport Manager TransportMgr 28, createdduring startup of the server instance, to create ReqMgr, theRequestManager singleton 29. The RequestManager 29 creates the“//server8000” instance of NetworkConnection-Listener 35, which listensfor client connection requests on a single network address.

In order to reference the exported Application Object offered by serviceprovider 21, the Service Consumer 11 creates a Client Context 13 called“ServerA” which creates “EndpointC1” 15 to the ServerA Client Context13. ClientContext 13 provides EndpointC1 15 an URL at which time theEndpoint 15 creates a “//server8000” Connection 16 passing in thenetwork address that the new Connection will use when creating aninstance of NetworkConnection-Established. EndpointC1 15 has not yetestablished a connection to a service provider, so the ClientContext 13doesn't yet know the Server Context's namespace ID.

FIG. 3 shows the client and server instances after the applicationprogram has referenced a service provider at least one time. The client11 has created an Endpoint 15 identified as EndpointC1, created aClientContext 13 and told the ClientContext 13 to use EndpointC1 15, andcreated a Proxy “AppObj1” 12. At some point EndpointC1 established theconnection 16 named “//server8000”, which initially connected to theNetworkConnection-Listener 35. The RequestManager 29 processed theinitial connection and created the “//server8000” instance ofNetworkConnection-Established 41, the Connection 42 containing the newconnection, the Endpoint 43 containing the Connection and theServiceRequestHandler 23. The ServiceRequestHandler 23 includes areference 45 mapping each ServerContext namespace Id that the serverinstance 21 is able to handle service requests for to the correspondingServerContext. In this example, the ServiceRequestHandler referencesonly the “ServerA” ServerContext 22, identified by namespace Id “10”.

The client application obtains AppObj1 12, the Proxy that references thedesired service instance, which causes AppObj1 12 to reference theClientContext 13 identified as ServerC1. Note that ServerC1 contains thesame service namespace id as the ServerContext 22 identified on theService Provider side as ServerA. In one embodiment, obtaining a proxytypically happens when a client application asks Voyager's directoryservice to look up a service provider's name, or when a serverapplication asks Voyager to create a service on a remote Voyager. Whileonly a single Proxy 12 is shown, multiple proxies for multiple servicesmay reference the same ClientContext 13.

The creation of NetworkConnection—Established happens when theconnection is needed, for example, when AppObj1 12 actually sends aServiceRequest to Service Provider 21. For the present purposes, it canbe said that NetworkConnection—Established is created as part ofobtaining the Proxy.

At this stage, the client application 11 can now use the AppObj1 proxy12 to request invocation of a service. This causes the Proxy to build aServiceRequest. A process for performing the service request is depictedin the flowchart 100 of FIG. 4. At step 101, the proxy AppObj1 12 handsthe ServiceRequest with a request identifier to the ClientContext 13identified as ServerC1. ServerC1 13 updates the ServiceRequest with aclient context identifier (a namespace Id) (step 102), and hands therequest to Endpoint EndpointC1 15 (step 103). EndpointC1 15 choosesConnection //server8000 16 to handle the request (step 104), and passesthe ServiceRequest to //server8000 16 (step 105), which passes theServiceRequest to NetworkConnection—Established 17 (step 106).

At step 107, NetworkConnection—Established 17 transfers theServiceRequest over the connection to the Service Provider instance 21.

When the Service Consumer 11 creates its NetworkConnection—Established17, the operating system establishes a connection to the listeningentity 35 on the Service Provider 21 side of the connection. At the timeof the connection, NetworkConnection—Listener 35 creates aNetworkConnection—Established 41. The NetworkConnection—Listener 35 thencreates Endpoint EndpointS1 43, passing in the newNetworkConnection—Established 41. EndpointS1 43 then creates Connection//server8000 42 and passes in the NetworkConnection—Established 41.

The handshake between the Service Consumer's EndpointC1 15 and theService Provider's EndpointS1 43 happens at this point. During thehandshake the ServiceConsumer's EndpointC1 15 will either set thenamespace id 18 of the ServerContext 22 in the ClientContext ServerC113, or if the value is already there, verify that the existing valuematches the namespace id value the handshake provided.

Continuing the process 100 of FIG. 4, the NetworkConnection—Establishedidentified as //server8000 41 now receives the ServiceRequest and passesit to the //server8000 Connection 42 (step 108). The //server8000Connection 42 passes the ServiceRequest to the Endpoint EndpointS1 43(step 109), which passes the ServiceRequest to C2, the singletonServiceRequestHandler 23 (step 110).

The ServiceRequestHandler 23 resolves the correct ServerContext for theServiceRequest (step 111) by retrieving the namespace id (10 in thisexample) from the ServiceRequest and using the namespace id to identifythe correct ServerContext 22. The ServiceRequestHandler 23 then passesthe Service Request to, in this case, the ServerContext ServerA (step112).

ServerA 22 retrieves the service id from the ServiceRequest and uses itto retrieve the service instance reference AppObj1 from theObjectRequestBroker 36 (step 113). ServerA 22 retrieves the servicearguments from the ServiceRequest and invokes the service (step 114).ServerA 22 then uses the result of the invocation to create aServerResponse object (step 115). ServerA 22 returns the ServerResponseto the Service Consumer application 11 (step 116) using essentially thesame path as the ServiceRequest (not shown in the diagram), i.e., aClientContext to an Endpoint to a Connection to aNetworkConnection—Established, over the physical network, and back tothe requesting Proxy.

FIG. 5 is similar to FIG. 3 but shows a second ServerContext 22 b with asecond ORB 36 b providing a second service 27 b, AppObj2. In the clientapplication 11, a second proxy 12 b has been created for AppObj2 with asecond ClientContext 13 b. FIG. 5 illustrates that between the ServiceConsumer and the Service Provider there is only a singleNetworkConnection-Established, with the supporting instances ofNetworkConnection 16/42, and Endpoint 15/43 on respective client andserver sides of the connection. That is, two proxies on the client sideare able to share an endpoint.

On the server side, a single ServiceRequestHandler is shared by bothServerContexts 22, 22 b. The ServiceRequestHandler 23 references bothServerContexts in field 45. When a service request is received by theServiceRequestHandler 23 (step 111) in the process 100 of FIG. 4, theServiceRequestHandler 23 resolves the correct ServiceContext of theServiceRequest so that the ServiceRequest is forwarded appropriately tothe correct ServerContext.

This sharing is made possible by the use of a unique namespace ID addedto a service request that uniquely identifies a server context within aserver application, so that service requests to the server application21 can be uniquely resolved.

The methods described above improve application performance by reusingand sharing resources whose creation costs are high.

In order to provide a unique ID when a server application includesmultiple server contexts, the ServerContext ID may be independent of anynetwork address of the server application 21. In addition to theefficiency advantages of sharing a connection, the use of the uniqueidentifier for a ServerContext also facilitates migration of a servercontext and associated ORB and services to other host devices in amanner that is transparent to the client application.

Although embodiments of the present invention have been illustrated inthe accompanied drawings and described in the foregoing description, itwill be understood that the invention is not limited to the embodimentsdisclosed, but is capable of numerous rearrangements, modifications, andsubstitutions without departing from the spirit of the invention as setforth and defined by the following claims. For example, the capabilitiesof the invention can be performed fully and/or partially by one or moreof the blocks, modules, processors or memories. Also, these capabilitiesmay be performed in the current manner or in a distributed manner andon, or via, any device able to provide and/or receive information.Further, although depicted in a particular manner, various modules orblocks may be repositioned without departing from the scope of thecurrent invention. Still further, although depicted in a particularmanner, a greater or lesser number of modules and connections can beutilized with the present invention in order to accomplish the presentinvention, to provide additional known features to the presentinvention, and/or to make the present invention more efficient. Also,the information sent between various modules can be sent between themodules via at least one of a data network, the Internet, an InternetProtocol network, a wireless source, and a wired source and viaplurality of protocols.

What is claimed is:
 1. A method, comprising: configuring a plurality ofserver contexts at a device, each of the plurality of server contextscomprising: a unique server context identity; and one or more indexedservices; wherein each of the plurality of server contexts is configuredto provide an indexed service in response to a service request, whereineach of the plurality of server contexts provides a minimal set of datato allow the one or more indexed services to be continued after beinginterrupted; configuring a service request handler to handle servicerequests for the plurality of server contexts; receiving a servicerequest into the service request handler from a service consumer;forwarding the service request to a server context of the plurality ofserver contexts corresponding to the service request; retrieving anindexed service in the server context; and generating a service responsein the server context, the service response comprising a result of aninvocation of the retrieved indexed service.
 2. The method of claim 1comprising: creating a connection between the service request handlerand the service consumer; and receiving a plurality of service requestsfor a plurality of the server contexts on the connection.
 3. The methodof claim 2 comprising: configuring a proxy in the service consumer as aproxy to an indexed service of one of the plurality of server contexts;and configuring a client context for the proxy that references a servercontext identity of the respective server context, wherein the clientcontext provides a minimal set of data to allow the indexed service tobe continued after being interrupted.
 4. The method of claim 3comprising: generating a service request in the proxy; providing theserver context identity from the client context into the servicerequest; sending the service request from the service consumer to aservice provider on the connection.
 5. The method of claim 1 comprisinggenerating a server context identity that is independent of a networkaddress of a service provider.
 6. A method for sharing a connection froma client application on a client device to a server application on aserver device comprising a plurality of server contexts, the methodcomprising: configuring a plurality of client contexts in the clientapplication, each client context comprising a reference to one of theplurality of server contexts; generating a plurality of service requestsfrom the plurality of client contexts, each service request comprising:a service request ID; a namespace ID that identifies one of theplurality of server contexts; and a service index that identifies aservice within the identified server context, wherein each of the clientcontexts and server contexts provides a minimal set of data to allow theservice to be continued after being interrupted; and providing theplurality of service requests from the client application to the serviceapplication on the connection.
 7. The method of claim 6 whereinconfiguring a client context comprises configuring an identity of theclient context as a namespace ID of a server context associated with theclient context.
 8. The method of claim 7 comprising configuring a singleclient context for each server context of the server application.
 9. Themethod of claim 6 comprising: receiving the service request in theserver application; passing the service request to a service requesthandler of the server application; resolving the namespace ID of theservice request; forwarding the service request to a server contextidentified by the namespace ID.
 10. The method of claim 6 comprisingestablishing a physical connection between the client application andthe server application on a network address that identifies the serverapplication.
 11. The method of claim 10 wherein the Namespace ID of aserver context is independent of the network address.
 12. The method ofclaim 6 comprising configuring the plurality of server contexts at aserver device, each server context comprising: a unique server contextidentity; a services index; and one or more services indexed by theservice index; wherein each server context is configured to provide aservice response comprising the result of an invocation of the retrievedindexed service in response to a service request.
 13. The method ofclaim 12 comprising configuring a service request handler to handleservice requests for the plurality of server contexts.
 14. The method ofclaim 13 comprising configuring a single server connection between theservice request handler and an endpoint of the client application.
 15. Asystem comprising: at least one server device executing a serverapplication configured to create a plurality of server contexts at anetwork address of the server device, each server context providing aminimal set of data to allow one or more referenced services to becontinued after being interrupted, comprising: a server context identityindependent of the network address; and the one or more referencedservices: at least one client device executing a client applicationconfigured to: create a plurality of client contexts as proxies for theone or more referenced services of a respective server context; generatea service request for the one or more referenced services, the servicerequest comprising a server context identity; wherein a plurality ofservice requests are provided to a plurality of the server contexts. 16.The system of claim 15 wherein the server application is configured tocreate a service request handler that references the plurality of servercontexts.
 17. The system of claim 16 wherein the service request handleris configured to: receive a service request; resolve a server contextidentity from the service request; and forward the service request tothe server context identified by the server context identity in theservice request.
 18. The system of claim 16 wherein the service requesthandler is configured to resolve service requests for each of theplurality of server contexts.
 19. The system of claim 15 wherein eachclient context stores a server context identity of the respective servercontext.
 20. The system of claim 15 wherein each server contextcomprises an object request broker that references the servicesavailable for the respective server context.